<template lang="">
        <div>
                <el-tree
                :data="data"
                show-checkbox
                node-key="id"
                :props="defaultProps"
                @check='getids'
              />
        </div>
    </template>
    <script>
    import axios from '../http/axios'
    export default {
        data(){
            return{
                data:[],
                defaultProps: {
                    children: 'children',
                    label: 'name',
                },
            }
        },
        methods: {
            getaudit(){
                //读取公司部门角色列表
                axios('getcomanyuser','get').then(res=>{
                    this.data = res.list
                })
            },
            getids(val1,status){
               this.checkdvalues=[]
               let list = status['checkedNodes']
               for(var i=0;i<list.length;i++){
                    if(list[i]['type'] == 3){
                        this.checkdvalues.push(list[i]['id'])
                    }
               }
            },
        },
        mounted() {
            this.getaudit()
        },
    }
    </script>
    <style lang="">
        
    </style>